<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>

<%
	String path = request.getContextPath();
	String ctx = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
	String wctx = request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="content-script-type" content="text/javascript">
	<meta http-equiv="content-style-type" content="text/css">
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
		body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
	</style>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=H3E7KaTNdghbAy1CNzstoU5ZEHl6fQSQ"></script>
	<!--加载鼠标绘制工具-->
	<script type="text/javascript" src="<%=ctx%>/websocket/DrawingManager_min.js"></script>
	<link rel="stylesheet" href="<%=ctx%>/websocket/DrawingManager_min.css" />
	<script type="text/javascript" src="<%=ctx%>/websocket/DistanceTool_min.js"/>
	<script type="text/javascript" src="<%=ctx%>/websocket/GeoUtils.js"></script>
	<script type="text/javascript" src="<%=ctx%>/websocket/AreaTool_min.js"></script>
	<!--加载检索信息窗口-->
	<script type="text/javascript" src="<%=ctx%>/websocket/SearchInfoWindow_min.js"></script>
	<script type="text/javascript" src="<%=ctx%>/websocket/jquery-1.12.3.min.js" ></script>
	<script type="text/javascript" src="<%=ctx%>/websocket/bootstrap.min.js" ></script>
	<link rel="stylesheet" href="<%=ctx%>/websocket/SearchInfoWindow_min.css" />
	<link rel="stylesheet" href="<%=ctx%>/websocket/bootstrap.min.css" />
	<link href="<%=ctx%>/websocket/toastr.css" rel="stylesheet"/>
	<script type="text/javascript" src="<%=ctx%>/websocket/toastr.js"></script>
	<title>协同会商</title>
	<style type="text/css">
		.maptoolimg {width:60px;height: 60px;
			display:inline-block;cursor:pointer;
			border-right: 1px solid #c4c7cc;margin-right: 5px;}
	</style>
</head>
<body>
<div id="allmap" style="overflow:hidden;zoom:1;position:relative;"></div>

<div id="divchat" class="container" style="position:absolute;z-index:9999;top:1px;left:1px;width:300px;height:100%">
	<div class="row">
		<div class="col-md-12" style="padding-left:0px;opacity:90%;position: relative;">
			<div class="panel panel-primary">
				<div class="panel-heading">
					<h3 class="panel-title" id="talktitle">消息窗口</h3>

				</div>
				<div id="log-container-father" class="panel-body" style="padding: 5px;">
					<div class="well" id="log-container" style="height:70%;overflow-y:scroll;margin-bottom:1px;padding:1px;">

					</div>

					<div class="col-md-12 text-center" style="height:70px;margin: 0 auto; padding: 0px;z-index: 999;">
						<%--<div style="width:50%">
						<button id="send" type="button" class="btn btn-primary btn-block">消息发送</button>
						</div>--%>
						<%--<input type="text" id="myinfo" class="form-control col-md-12"/>--%>
						<textarea  id="myinfo" class="form-control col-md-12" rows="3"></textarea>
						<button id="broadcast" type="button" class="btn btn-primary btn-block">发送消息</button>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div id="divchat_hide" class="ssDiv" style="position:absolute;z-index:9999;top:1px;left:285px;background:#1c6dab;padding:6px;border-radius: 4px;boxing-sizing:border-box;cursor: pointer;">
	<img src="<%=ctx%>/websocket/image/hidden.png" width="20" alt="">
</div>
<div id="divchat_show" class="ssDiv2"  style="display:none;position:absolute;z-index:9999;top:1px;left:1px;background:#1c6dab;padding:6px;border-radius: 4px;boxing-sizing:border-box;cursor: pointer;">
	<img src="<%=ctx%>/websocket/image/show.png" width="20" alt="消息窗口">
</div>


<div id="divuser" class="container2" style="display:none;position:absolute;z-index:9999;top:30px;right:0px;width:200px;">
		<div class="col-md-12" style="padding-right:0px;opacity:80%;">
			<div class="panel panel-primary" id="online">
				<div class="panel-heading">
					<h3 class="panel-title">在线用户</h3>
				</div>
				<div class="panel-body">
					<div class="list-group" id="users">
					</div>
				</div>
			</div>
		</div>
</div>
</body>
</html>
<script type="text/javascript">
    var websocket;
    var enabledDraw=false;
    var big;
    var small;
	var maker;
	var circle;
    var polyline;
    var polygon;
    var rectangle;
    var textmaker;
    var linecolor;
    var clearall;
    // 百度地图API功能
    var map = new BMap.Map("allmap",{mapType:BMAP_SATELLITE_MAP});    // 创建Map实例
    map.centerAndZoom(new BMap.Point(116.62227,34.700601), 12);  // 初始化地图,设置中心点坐标和地图级别
    map.addControl(new BMap.MapTypeControl({ anchor: BMAP_ANCHOR_BOTTOM_RIGHT }));   //添加地图类型控件
    map.setCurrentCity("丰县");          // 设置地图显示的城市 此项是必须设置的

    map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
    map.enableContinuousZoom(true);    //启用地图惯性拖拽，默认禁用
    var myDis = new BMapLib.DistanceTool(map);   //测距插件
    var measureAreaTool = createMeasureAreaTool(map);//添加测量面积工具

    //map.addControl(new BMap.NavigationControl());  //添加默认缩放平移控件
    //map.addControl(new BMap.ScaleControl({ anchor: BMAP_ANCHOR_BOTTOM_LEFT })); //向地图中添加比例尺控件
    //------------------------ 显示镇级范围 ------------------
    var polygons = [];

    function getBoundary() {
        var bdary = new BMap.Boundary();
        bdary.get("徐州市丰县", function (rs) {       //获取行政区域
            //map.clearOverlays();        //清除地图覆盖物
            var count = rs.boundaries.length; //行政区域的点有多少个
            if (count === 0) {
                alert('未能获取当前输入行政区域');
                return;
            }
            var pointArray = [];
            for (var i = 0; i < count; i++) {
                var ply = new BMap.Polygon(rs.boundaries[i], { strokeWeight: 2, strokeColor: "#ff0000",fillOpacity:0.1 }); //建立多边形覆盖物
                //ply.enableEditing();  //范围可编辑
                map.addOverlay(ply);  //添加覆盖物
                pointArray = pointArray.concat(ply.getPath());
                polygons.push(ply);
            }
            map.setViewport(pointArray);    //调整视野
            //addlabel();
        });
    }
    setTimeout(function () {
        getBoundary();
        gongju();
        drawDisable(false);
        var c_height = $(window).height() - 125;
        $("#log-container").height(c_height);
    }, 2000);
    //========================================================
    var overlays = [];
    var overlaycomplete = function(e){
        overlays.push(e.overlay);
        var overarr=[];
        if("marker"==e.drawingMode){
            overarr.push(e.overlay.getPosition());
		}else{
            overarr=e.overlay.getPath();
		}
		var jsonstr="{\"path\":[";
        for(var i=0;i<overarr.length;i++){
			if(i>0){
                jsonstr+=",";
			}
            jsonstr+="{\"lng\":"+overarr[i].lng+","+"\"lat\":"+overarr[i].lat+"}";
        }
        jsonstr+="],\"drawingMode\":\""+e.drawingMode+"\"";
        jsonstr+=",\"drawingUser\":\"${sessionScope.username}\"";
        jsonstr+=",\"styleOptions\":"+JSON.stringify(styleOptions);
        jsonstr+="}";
        var jsonObject= jQuery.parseJSON(jsonstr);
        var blob = new Blob([jsonstr], {type: 'text/plain'});
        websocket.send(blob);
    };
    var styleOptions = {
        strokeColor:"red",    //边线颜色。
        fillColor:"red",      //填充颜色。当参数为空时，圆形将没有填充效果。
        strokeWeight: 3,       //边线的宽度，以像素为单位。
        strokeOpacity: 0.8,	   //边线透明度，取值范围0 - 1。
        fillOpacity: 0.6,      //填充的透明度，取值范围0 - 1。
        strokeStyle: 'solid' //边线的样式，solid或dashed。
    }
    //实例化鼠标绘制工具
    var drawingManager = new BMapLib.DrawingManager(map, {
        isOpen: false, //是否开启绘制模式
        enableDrawingTool: false, //是否显示工具栏
        drawingToolOptions: {
            anchor: BMAP_ANCHOR_TOP_RIGHT, //位置
            offset: new BMap.Size(5, 5), //偏离值
        },
        circleOptions: styleOptions, //圆的样式
        polylineOptions: styleOptions, //线的样式
        polygonOptions: styleOptions, //多边形的样式
        rectangleOptions: styleOptions //矩形的样式
    });
    //drawingManager.enableCalculate();
    function draw(type){
        drawingManager.open();
        drawingManager.setDrawingMode(type);
    }
    //添加鼠标绘制工具监听事件，用于获取绘制结果
    drawingManager.addEventListener('overlaycomplete', overlaycomplete);
    function drawClose(){
        drawingManager.close();
        map.enableDragging();
        enabledDraw=true;
        var jsonstr="{\"drawingMode\":\"disabledrag\"";
        jsonstr+=",\"drawingUser\":\"${sessionScope.username}\"";
        jsonstr+="}";
        var jsonObject= jQuery.parseJSON(jsonstr);
        var blob = new Blob([jsonstr], {type: 'text/plain'});
        websocket.send(blob);
    }
    function clearAll() {
        /*for(var i = 0; i < overlays.length; i++){
            map.removeOverlay(overlays[i]);
        }*/
        drawingManager.close();
        map.clearOverlays();
        var jsonstr="{\"drawingMode\":\"clearOverlays\"";
        jsonstr+=",\"drawingUser\":\"${sessionScope.username}\"";
        jsonstr+="}";
        var jsonObject= jQuery.parseJSON(jsonstr);
        var blob = new Blob([jsonstr], {type: 'text/plain'});
        websocket.send(blob);
    }
    map.addEventListener("dragend", function(){
        var center =map.getCenter();
        var ZoomNum = map.getZoom();
        var overarr=[];
        overarr.push(center);
        var jsonstr="{\"path\":[";
        for(var i=0;i<overarr.length;i++){
            if(i>0){
                jsonstr+=",";
            }
            jsonstr+="{\"lng\":"+overarr[i].lng+","+"\"lat\":"+overarr[i].lat+"}";
        }
        jsonstr+="],\"drawingMode\":\"dragend\"";
        jsonstr+=",\"drawingUser\":\"${sessionScope.username}\"";
        jsonstr+=",\"zoomnum\":"+ZoomNum;
        jsonstr+="}";
        var jsonObject= jQuery.parseJSON(jsonstr);

        var blob = new Blob([jsonstr], {type: 'text/plain'});
        websocket.send(blob);
    });
    map.addEventListener("zoomend", function(e){
        var ZoomNum = map.getZoom();
        var jsonstr="{\"zoomnum\":"+ZoomNum;
        jsonstr+=",\"drawingMode\":\"zoomend\"";
        jsonstr+=",\"drawingUser\":\"${sessionScope.username}\"";
        jsonstr+="}";
        var jsonObject= jQuery.parseJSON(jsonstr);
        var blob = new Blob([jsonstr], {type: 'text/plain'});
        websocket.send(blob);
    });
//================================================================websocket====================================================================
    $(document).ready(function() {
        // 指定websocket路径
        if ('MozWebSocket' in window) {
            websocket = new MozWebSocket("ws://<%=wctx%>/ws?username=${sessionScope.username}");
        } else if ('WebSocket' in window) {
            websocket = new WebSocket("ws://<%=wctx%>/ws?username=${sessionScope.username}");
        } else {
            websocket = new SockJS("ws://<%=wctx%>/ws?username=${sessionScope.username}");
        }
        websocket.onmessage = function(event) {
            var rdata=event.data;
            console.log("======================"+typeof(rdata)+"====================");
            if(typeof(rdata)=="string"){
				var data=JSON.parse(rdata);
				if(data.from==0){//上线消息
					if(data.text!="${sessionScope.username}")
					{
						$("#users").append('<a href="#" onclick="talk(this)" class="list-group-item">'+data.text+'</a>');
						//alert(data.text+"上线了");
                        toastr.info(data.text+"上线了");
					}
				}else if(data.from==-2){//下线消息
					if(data.text!="${sessionScope.username}")
					{
						$("#users > a").remove(":contains('"+data.text+"')");
						//alert(data.text+"下线了");
                        toastr.info(data.text+"下线了");
					}
				}else{//用户或者群消息
                    // 接收服务端的实时消息并添加到HTML页面中
                    toastr.info(data.fromName+"说:"+data.text.substring(0,15)+"...");
                    $("#log-container").append("<div class='bg-info'><label class='text-danger'>"+data.fromName+"&nbsp;"+data.date+"</label><div class='text-success'>"+data.text+"</div></div><br>");
                    // 滚动条滚动到最低部
                    scrollToBottom();
                }
			}else{
                var reader = new FileReader();
                var readerResult;
                reader.readAsText(rdata);
                reader.onload = function (e) {
                    readerResult=reader.result;
                    var jsonObject= jQuery.parseJSON(readerResult);
                    console.log(jsonObject);
                    var drawingMode=jsonObject["drawingMode"];
                    var drawingUser=jsonObject["drawingUser"];
                    if(drawingUser!="${sessionScope.username}"){
                        if("rectangle"==drawingMode||"polyline"==drawingMode||"circle"==drawingMode||"polygon"==drawingMode){
                            var path=jsonObject["path"];
                            var styleOptionsjson=jsonObject["styleOptions"];
                            var Points = [];
                            for(var i in path){
                                var bmappoint=new BMap.Point(path[i].lng,path[i].lat);
                                Points.push(bmappoint);
                            }
                            var polygon =new BMap.Polygon(Points,styleOptionsjson);
                            map.addOverlay(polygon);
                        }else if("marker"==drawingMode){
                            var path=jsonObject["path"];
                            var bmappoint=new BMap.Point(path[0].lng,path[0].lat);
                            var marker =new BMap.Marker(bmappoint,styleOptions);
                            map.addOverlay(marker);
						}else if("zoomend"==drawingMode){
                            var zoomnum=jsonObject["zoomnum"];
                            map.setZoom(zoomnum);
                        }else if("dragend"==drawingMode){
                            var path=jsonObject["path"];
                            var bmappoint=new BMap.Point(path[0].lng,path[0].lat);
                            var zoomnum=jsonObject["zoomnum"];
                            //map.setCenter(bmappoint);
                            map.centerAndZoom(bmappoint, zoomnum);
                        }else if("disabledrag"==drawingMode){
                            map.disableDragging();//禁止拖拽
                            drawingManager.close();
                            enabledDraw=false;
                            drawDisable(false);
						}
                        else if("clearOverlays"==drawingMode){
                            map.clearOverlays();
                        }
					}
                }
			}
        };
        websocket.onerror = function(event) {
            toastr.error("您已掉线");
		}
        $.post("onlineusers",function(data){
            for(var i=0;i<data.length;i++)
                $("#users").append('<a href="#" onclick="talk(this)" class="list-group-item">'+data[i]+'</a>');
        });

        $("#broadcast").click(function(){
            var v=$("#myinfo").val();
            if(v=="") {
                return;
            }
            //$.post("broadcast",{"text":$("#myinfo").val()});
            //$("#myinfo").val("");
            var data={};
            data["from"]=1;
            data["fromName"]="${sessionScope.username}";
            data["to"]=-1;
            data["toName"]="";
            data["text"]=v;
            websocket.send(JSON.stringify(data));
            //$("#log-container").append("<div class='bg-success'><label class='text-info'>我&nbsp;"+formatDateTime(new Date())+"</label><div class='text-info'>"+v+"</div></div><br>");
            //scrollToBottom();
            $("#myinfo").val("");
        });

        $("#send").click(function(){
                var toName=$("body").data("to");
                var v=$("#myinfo").val();
                if(v==""){
                    return;
                }else{
                    var data={};
                    data["from"]="";
                    data["fromName"]="${sessionScope.username}";
                    //data["to"]=d.uid;
                    data["toName"]=toName;
                    data["text"]=v;
                    websocket.send(JSON.stringify(data));
                    $("#log-container").append("<div class='bg-success'><label class='text-info'>我&nbsp;"+formatDateTime(new Date())+"</label><div class='text-info'>"+v+"</div></div><br>");
                    scrollToBottom();
                    $("#myinfo").val("");
                }

        });

    });

    function talk(a){
        $("#talktitle").text("与"+a.innerHTML+"的聊天");
        $("body").data("to",a.innerHTML);
    }
    function scrollToBottom(){
        var div = document.getElementById('log-container');
        div.scrollTop = div.scrollHeight;
    }
// ================================================================websocket====================================================================
    function gongju() {
        // 自定义控件
        function ZoomControl() {
            this.defaultAnchor = BMAP_ANCHOR_TOP_RIGHT;
            this.defaultOffset = new BMap.Size(50, 1);
        }
        /*var size = new BMap.Size(350, 1);
        map.addControl(new BMap.CityListControl({
            anchor : BMAP_ANCHOR_TOP_RIGHT,
            offset : size,
        }));*/
        // 继承BMap.Control
        ZoomControl.prototype = new BMap.Control;
        // 控件初始化
        ZoomControl.prototype.initialize = function(map) {
            var div = document.createElement('div');
            var view = document.createElement('img');
            big = document.createElement('img');
            small = document.createElement('img');
            maker = document.createElement('img');
            circle = document.createElement('img');
            polyline = document.createElement('img');
            polygon = document.createElement('img');
            rectangle = document.createElement('img');
            textmaker = document.createElement('img');
            linecolor = document.createElement('div');
            clearall = document.createElement('img');
            // big.appendChild(document.createTextNode('&nbsp;&nbsp;&nbsp;&nbsp;'));
            div.appendChild(view);
            div.appendChild(big);
            div.appendChild(small);
            div.appendChild(maker);
            div.appendChild(circle);
            div.appendChild(polyline);
            div.appendChild(polygon);
            div.appendChild(rectangle);
            div.appendChild(textmaker);
            div.appendChild(clearall);
            div.appendChild(linecolor);
            div.style.borderRight = 'solid 1px #c4c7cc';
            div.style.borderTop = 'solid 1px #c4c7cc';
            div.style.borderBottom = 'solid 1px #c4c7cc';
            //div.style.height = '70px';
            div.style.background = '#fff';
            div.style.fontSize = '13px';
            div.style.color = '#000';
            div.style.textAlign = 'center';
            div.style.lineHeight = '70px';

            // big.style.borderRight = 'dashed 1px #c4c7cc';
            view.className="maptoolimg";
            view.src = '<%=ctx%>/websocket/image/漫游.png';
            view.style.cursor="pointer";

            big.className="maptoolimg";
            big.src = '<%=ctx%>/websocket/image/放大.png';

            small.className="maptoolimg";
            small.src = '<%=ctx%>/websocket/image/缩小.png';

            maker.className="maptoolimg";
            maker.src = '<%=ctx%>/websocket/image/画点.png';

            circle.className="maptoolimg";
            circle.src = '<%=ctx%>/websocket/image/画圆.png';

            polyline.className="maptoolimg";
            polyline.src = '<%=ctx%>/websocket/image/画折线.png';

            polygon.className="maptoolimg";
            polygon.src = '<%=ctx%>/websocket/image/画多边形.png';

            rectangle.className="maptoolimg";
            rectangle.src = '<%=ctx%>/websocket/image/画矩形.png';

            textmaker.className="maptoolimg";
            textmaker.src = '<%=ctx%>/websocket/image/标注.png';

            clearall.className="maptoolimg";
            clearall.src = '<%=ctx%>/websocket/image/清除.png';

            linecolor.style.display = 'inline-block';
            linecolor.style.width = '60px';
            linecolor.style.height = '24px';
            linecolor.style.marginRight = '5px';
            //linecolor.src = 'images/map/线条颜色.png';
        	var selecthtml='<select id=\"stylelist\" onchange=\"styleOptions.fillColor=this.value;styleOptions.strokeColor=this.value;\">';
            selecthtml+='<option value=\"red\">红色</option><option value=\"dark\">黑色</option>';
            selecthtml+='<option value=\"blue\">蓝色</option>';
            selecthtml+='<option value=\"green\">绿色</option></select>';
            linecolor.innerHTML=selecthtml;

            // 注册点击事件
            view.onclick = function() {
                drawClose();
                drawDisable(true);
            };
            big.onclick = function() {
                if(!enabledDraw){
                    return;
				}
                map.zoomTo(map.getZoom() + 1);
            };
            small.onclick = function() {
                if(!enabledDraw){
                    return;
                }
                map.zoomTo(map.getZoom() - 1);
            }
            maker.onclick = function() {
                if(!enabledDraw){
                    return;
                }
                draw(BMAP_DRAWING_MARKER);
            }
            circle.onclick = function() {
                if(!enabledDraw){
                    return;
                }
                draw(BMAP_DRAWING_CIRCLE);
            }
            polyline.onclick = function() {
                if(!enabledDraw){
                    return;
                }
                draw(BMAP_DRAWING_POLYLINE);
            }
            polygon.onclick = function() {
                if(!enabledDraw){
                    return;
                }
                draw(BMAP_DRAWING_POLYGON);
            }
            rectangle.onclick = function() {
                if(!enabledDraw){
                    return;
                }
                draw(BMAP_DRAWING_RECTANGLE);
            }
            clearall.onclick = function() {
                if(!enabledDraw){
                    return;
                }
                clearAll();
            }
            textmaker.onclick = function() {
                //myDis.open();
                measureAreaTool.open();
            }
            linecolor.onclick = function() {

            }
            // 添加控件到地图
            map.getContainer().appendChild(div);
            return div;
        };

        // 添加自定义控件到地图
        var myZoomControl = new ZoomControl();
        map.addControl(myZoomControl);
    }
    var formatDateTime = function (date) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        m = m < 10 ? ('0' + m) : m;
        var d = date.getDate();
        d = d < 10 ? ('0' + d) : d;
        var h = date.getHours();
        h=h < 10 ? ('0' + h) : h;
        var minute = date.getMinutes();
        minute = minute < 10 ? ('0' + minute) : minute;
        var second=date.getSeconds();
        second=second < 10 ? ('0' + second) : second;
        return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second;
    };
    //菜单收缩
    $("#divchat_hide").click(function () {
        $("#divchat").css("display","none");
        $("#divchat_hide").css("display","none");
        $("#divchat_show").css("display","block");
    })
    $("#divchat_show").click(function () {
        $("#divchat").css("display","block");
        $("#divchat_hide").css("display","block");
        $("#divchat_show").css("display","none");
        var c_height = $(window).height() - 170;
        $("#log-container").height(c_height);
    })
    function drawDisable(val){
        if(val){
            big.src="<%=ctx%>/websocket/image/放大.png";
            small.src="<%=ctx%>/websocket/image/缩小.png";
            maker.src="<%=ctx%>/websocket/image/画点.png";
            circle.src="<%=ctx%>/websocket/image/画圆.png";
            polyline.src="<%=ctx%>/websocket/image/画折线.png";
            polygon.src="<%=ctx%>/websocket/image/画多边形.png";
            rectangle.src="<%=ctx%>/websocket/image/画矩形.png";
            textmaker.src="<%=ctx%>/websocket/image/标注.png";
            clearall.src="<%=ctx%>/websocket/image/清除.png";
            big.style.cursor="pointer";
            small.style.cursor="pointer";
            maker.style.cursor="pointer";
            circle.style.cursor="pointer";
            polyline.style.cursor="pointer";
			polygon.style.cursor="pointer";
            rectangle.style.cursor="pointer";
            textmaker.style.cursor="pointer";
            clearall.style.cursor="pointer";
		}
        else{
            big.src="<%=ctx%>/websocket/image/disable/放大.png";
            small.src="<%=ctx%>/websocket/image/disable/缩小.png";
            maker.src="<%=ctx%>/websocket/image/disable/画点.png";
            circle.src="<%=ctx%>/websocket/image/disable/画圆.png";
            polyline.src="<%=ctx%>/websocket/image/disable/画折线.png";
            polygon.src="<%=ctx%>/websocket/image/disable/画多边形.png";
            rectangle.src="<%=ctx%>/websocket/image/disable/画矩形.png";
            textmaker.src="<%=ctx%>/websocket/image/disable/标注.png";
            clearall.src="<%=ctx%>/websocket/image/disable/清除.png";
            big.style.cursor="default";
            small.style.cursor="default";
            maker.style.cursor="default";
            circle.style.cursor="default";
            polyline.style.cursor="default";
            polygon.style.cursor="default";
            rectangle.style.cursor="default";
            textmaker.style.cursor="default";
            clearall.style.cursor="default";
		}
	}
    toastr.options = {
        "closeButton": false,
        "debug": false,
        "newestOnTop": false,
        "progressBar": false,
        "positionClass": "toast-bottom-right",
        "preventDuplicates": false,
        "onclick": null,
        "showDuration": "300",
        "hideDuration": "1000",
        "timeOut": "5000",
        "extendedTimeOut": "1000",
        "showEasing": "swing",
        "hideEasing": "linear",
        "showMethod": "fadeIn",
        "hideMethod": "fadeOut"
    }
</script>
